<%@page import="java.util.ArrayList"%>
<%@page import="com.jlrdb.model.DigitalRadioBroadcast"%>
<%@page import="com.jlrdb.model.DigitalRadioBroadcasts"%>
<%@page import="com.jlrdb.model.AnalogRadioBroadcast"%>
<%@page import="com.jlrdb.model.AnalogRadioBroadcasts"%>
<%@page import="com.jlrdb.model.TvBroadcast"%>
<%@page import="com.jlrdb.model.TvBroadcasts"%>
<%@page import="com.jlrdb.model.CellularBroadcast"%>
<%@page import="com.jlrdb.model.CellularBroadcasts"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="/css/report.css">
<title>View Radio Broadcasts</title>
</head>
<body>
	<%
		DigitalRadioBroadcasts digitalRadioBroadcasts = (DigitalRadioBroadcasts) request.getAttribute("digitalRadioBroadcasts");
		AnalogRadioBroadcasts analogRadioBroadcasts = (AnalogRadioBroadcasts) request.getAttribute("analogRadioBroadcasts");
		TvBroadcasts tvBroadcasts = (TvBroadcasts) request.getAttribute("tvBroadcasts");
		CellularBroadcasts cellularBroadcasts = (CellularBroadcasts) request.getAttribute("cellularBroadcasts");
		String country = (String) request.getAttribute("country");
		HttpSession session1 = request.getSession();
		String role = (String) session1.getAttribute("Role");
	%>
	<h3>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Country: <font color="blue"><%=country%></font>
	</h3>
	<%
		if (role.equalsIgnoreCase("Admin"))
		{
	%>
	<p>
		<font color="red">click on UPDATE DETAILS to update data.</font>
	</p>
	<%
		}
	%>
	<h4>&nbsp;&nbsp;&nbsp;TV DATA</h4>
	<%
		if (tvBroadcasts.getTvBroadcasts().size() != 0)
		{
	%>
	<%
		for (TvBroadcast tvBroadcast : tvBroadcasts.getTvBroadcasts())
			{
	%>
	<div id="content">
		<%
			if (role.equalsIgnoreCase("Admin"))
					{
		%>
		<p align="center">
			<a href="/TvBroadcastServlet?action=getThisBroadcast&&broadcastId=<%=tvBroadcast.getBroadcastId()%>">UPDATE DETAILS</a>
		</p>
		<%
			}
		%>
		<br>
		<table style="float: left; position: relative; margin-right: auto; width: 45%;">
			<tr>
				<th>DTT Standard:</th>
				<td><%=tvBroadcast.getDtt_Standard()%></td>
			</tr>
			<tr>
				<th>DTT Status:</th>
				<td><%=tvBroadcast.getDtt_Status()%></td>
			</tr>
			<tr>
				<th>Analog Standard:</th>
				<td><%=tvBroadcast.getAnalog_Standard()%></td>
			</tr>
			<tr>
				<th>ASO Date Start::</th>
				<td><%=tvBroadcast.getAso_Date_Start()%></td>
			</tr>
			<tr>
				<th>ASO Date Completion:</th>
				<td><%=tvBroadcast.getAso_Date_Completion()%></td>
			</tr>
			<tr>
				<th>ASO Status:</th>
				<td><%=tvBroadcast.getAso_Status()%></td>
			</tr>
			<tr>
				<th>DSO Date Start:</th>
				<td><%=tvBroadcast.getDso_Date_Start()%></td>
			</tr>
			<tr>
				<th>DSO Date Completion:</th>
				<td><%=tvBroadcast.getAso_Date_Completion()%></td>
			</tr>
			<tr>
				<th>DSO Status:</th>
				<td><%=tvBroadcast.getDso_Status()%></td>
			</tr>
			<tr>
				<th>Next Transition Planned:</th>
				<td><%=tvBroadcast.getNext_Transition_Planned()%></td>
			</tr>
			<tr>
				<th>Standard Transition Into:</th>
				<td><%=tvBroadcast.getStandard_Transition_Into()%></td>
			</tr>
			<tr>
				<th>Status:</th>
				<td><%=tvBroadcast.getStatus()%></td>
			</tr>
			<tr>
				<th>Start Date:</th>
				<td><%=tvBroadcast.getStart_Date()%></td>
			</tr>
			<tr>
				<th>Notes:</th>
				<td><%=tvBroadcast.getNotes()%></td>
			</tr>
			<tr>
				<th>Status Confirmed:</th>
				<td><%=tvBroadcast.getStatus_Confirmed()%></td>
			</tr>
			<tr>
				<th>Last Date Verified:</th>
				<td><%=tvBroadcast.getLast_Date_Verified()%></td>
			</tr>
			<tr>
				<th>Video Format Supported:</th>
				<td><%=tvBroadcast.getVideo_Format_Supported()%></td>
			</tr>
		</table>
		<table style="position: relative; width: 45%;">
			<tr>
				<th>Operators:</th>
				<td><%=tvBroadcast.getOperators()%></td>
			</tr>
			<tr>
				<th>MUX Details:</th>
				<td><%=tvBroadcast.getMux_Details()%></td>
			</tr>
			<tr>
				<th>DTT Coverage:</th>
				<td><%=tvBroadcast.getDtt_Coverage()%></td>
			</tr>
			<tr>
				<th>HD Present:</th>
				<td><%=tvBroadcast.getHd_Present()%></td>
			</tr>
			<tr>
				<th>Audio Formats:</th>
				<td><%=tvBroadcast.getAudio_Formats()%></td>
			</tr>
			<tr>
				<th>Frequency Bands:</th>
				<td><%=tvBroadcast.getFrequency_Bands()%></td>
			</tr>
			<tr>
				<th>Interactive Standards:</th>
				<td><%=tvBroadcast.getInteractive_Standards()%></td>
			</tr>
			<tr>
				<th>Channel Bandwidth:</th>
				<td><%=tvBroadcast.getChannel_Bandwidth()%></td>
			</tr>
			<tr>
				<th>Carrier Type:</th>
				<td><%=tvBroadcast.getCarrier_Type()%></td>
			</tr>
			<tr>
				<th>Modulation:</th>
				<td><%=tvBroadcast.getModulation()%></td>
			</tr>
			<tr>
				<th>Broadcast Authority:</th>
				<td><%=tvBroadcast.getBroadcast_Authority()%></td>
			</tr>
			<tr>
				<th>ITU Region:</th>
				<td><%=tvBroadcast.getItu_Region()%></td>
			</tr>
			<tr>
				<th>Broadcasters:</th>
				<td><%=tvBroadcast.getBroadcasters()%></td>
			</tr>
			<tr>
				<th>Source Of Reference:</th>
				<td>
					<%
						String full = tvBroadcast.getSource_Of_Reference();
								String parts[] = full.split("[\\r\\n]+");
								for (String s : parts)
								{
									if (s.contains("http"))
									{
					%>
					<p>
						<a href="<%=s%>" target="_blank"><%=s%></a>
					</p> <%
 	} else
 				{
 %>
					<p><%=s%></p> <%
 	}
 			}
 %>
				</td>
			</tr>
		</table>
	</div>
	<br>
	<%
		}
		} else
		{
	%>
	<p>
		No TV data Available for
		<%=country%></p>
	<%
		}
	%>
	<h4>&nbsp;&nbsp;&nbsp;CELLULAR DATA</h4>
	<%
		if (cellularBroadcasts.getCellularBroadcasts().size() != 0)
		{
	%>
	<%
		for (CellularBroadcast cellularBroadcast : cellularBroadcasts.getCellularBroadcasts())
			{
	%>
	<div id="content">
		<%
			if (role.equalsIgnoreCase("Admin"))
					{
		%>
		<p align="center">
			<a href="/CellularBroadcastServlet?action=getThisBroadcast&&broadcastId=<%=cellularBroadcast.getBroadcast_Id()%>">UPDATE DETAILS</a>
		</p>
		<%
			}
		%>
		<br>
		<table style="width: 80%;">
			<tr>
				<th>Cellular Technology:</th>
				<td><%=cellularBroadcast.getCellular_Technology()%></td>
			</tr>
			<tr>
				<th>Data Enhancement Technology:</th>
				<td><%=cellularBroadcast.getData_Enhancement_Technology()%></td>
			</tr>
			<tr>
				<th>Information Transfer Rate:</th>
				<td><%=cellularBroadcast.getInformation_Transfer_Rate()%></td>
			</tr>
			<tr>
				<th>Start Date:</th>
				<td><%=cellularBroadcast.getStart_Date()%></td>
			</tr>
			<tr>
				<th>End Date:</th>
				<td><%=cellularBroadcast.getEnd_Date()%></td>
			</tr>
			<tr>
				<th>Frequency Spectrum MHz:</th>
				<td><%=cellularBroadcast.getFrequency_Spectrum()%></td>
			</tr>
			<tr>
				<th>Market Penetration:</th>
				<td><%=cellularBroadcast.getMarket_Penetration()%></td>
			</tr>
			<tr>
				<th>Operators:</th>
				<td><%=cellularBroadcast.getOperators()%></td>
			</tr>
			<tr>
				<th>Source of reference:</th>
				<td>
					<%
						String full = cellularBroadcast.getSource_Of_Reference();
								String parts[] = full.split("[\\r\\n]+");
								for (String s : parts)
								{
									if (s.contains("http"))
									{
					%>
					<p>
						<a href="<%=s%>" target="_blank"><%=s%></a>
					</p> <%
 	} else
 				{
 %>
					<p><%=s%></p> <%
 	}
 			}
 %>
				</td>
			</tr>
			<tr>
				<th>Additional Contacts:</th>
				<td><%=cellularBroadcast.getAditional_Contacts()%></td>
			</tr>
			<tr>
				<th>Industry Regulators:</th>
				<td><%=cellularBroadcast.getIndustry_Regulators()%></td>
			</tr>
			<tr>
				<th>Market Confirmation:</th>
				<td><%=cellularBroadcast.getMarket_Confirmation()%></td>
			</tr>
			<tr>
				<th>Notes/Remarks/Forecast:</th>
				<td><%=cellularBroadcast.getNotes()%></td>
			</tr>
			<tr>
				<th>Drawbacks and Plan to overcome:</th>
				<td><%=cellularBroadcast.getProblems()%></td>
			</tr>
		</table>
	</div>
	<br>
	<%
		}
		} else
		{
	%>
	<p>
		No CELLULAR data Available for
		<%=country%></p>
	<%
		}
	%>
	<h4>&nbsp;&nbsp;&nbsp;DIGITAL RADIO DATA</h4>
	<%
		if (digitalRadioBroadcasts.getDigitalRadioBroadcasts().size() != 0)
		{
	%>
	<%
		for (DigitalRadioBroadcast radioBroadcast : digitalRadioBroadcasts.getDigitalRadioBroadcasts())
			{
	%>
	<div id="content">
		<%
			if (role.equalsIgnoreCase("Admin"))
					{
		%>
		<p align="center">
			<a href="/RadioBroadcastServlet?action=getThisBroadcastDigital&&broadcastId=<%=radioBroadcast.getBroadcast_Id()%>">UPDATE DETAILS</a>
		</p>
		<%
			}
		%>
		<br>
		<table style="float: left; position: relative; margin-right: auto; width: 45%;">
			<tr>
				<th>Analog Radio:</th>
				<td><%=radioBroadcast.getAnalog_radio()%></td>
			</tr>
			<tr>
				<th>Digitization Status:</th>
				<td><%=radioBroadcast.getDigitization_Status()%></td>
			</tr>
			<tr>
				<th>Digital Radio Family:</th>
				<td><%=radioBroadcast.getDigital_Radio_Family()%></td>
			</tr>
			<tr>
				<th>Standard:</th>
				<td><%=radioBroadcast.getStandard()%></td>
			</tr>
			<tr>
				<th>Transmission Status:</th>
				<td><%=radioBroadcast.getTransmission_Status()%></td>
			</tr>
			<tr>
				<th>Coverage:</th>
				<td><%=radioBroadcast.getCoverage()%></td>
			</tr>
			<tr>
				<th>Start Date:</th>
				<td><%=radioBroadcast.getStart_Date()%></td>
			</tr>
			<tr>
				<th>Stop date:</th>
				<td><%=radioBroadcast.getStop_date()%></td>
			</tr>
			<tr>
				<th>Notes:</th>
				<td><%=radioBroadcast.getNotes()%></td>
			</tr>
		</table>
		<table style="position: relative; width: 45%;">
			<tr>
				<th>Frequency Spectrum:</th>
				<td><%=radioBroadcast.getFrequency_Spectrum()%></td>
			</tr>
			<tr>
				<th>Major Players:</th>
				<td><%=radioBroadcast.getMajor_Players()%></td>
			</tr>
			<tr>
				<th>Digital Radio Overall coverage:</th>
				<td><%=radioBroadcast.getDigital_Radio_Overall_coverage()%></td>
			</tr>
			<tr>
				<th>MultiPlex:</th>
				<td><%=radioBroadcast.getMultiPlex()%></td>
			</tr>
			<tr>
				<th>ASO Start Date:</th>
				<td><%=radioBroadcast.getASO_Start_Date()%></td>
			</tr>
			<tr>
				<th>ASO End Date:</th>
				<td><%=radioBroadcast.getASO_End_Date()%></td>
			</tr>
			<tr>
				<th>Regulatory authority:</th>
				<td><%=radioBroadcast.getRegulatory_authority()%></td>
			</tr>
			<tr>
				<th>Source:</th>
				<td>
					<%
						String full = radioBroadcast.getSource();
								String parts[] = full.split("[\\r\\n]+");
								for (String s : parts)
								{
									if (s.contains("http"))
									{
					%>
					<p>
						<a href="<%=s%>" target="_blank"><%=s%></a>
					</p> <%
 	} else
 				{
 %>
					<p><%=s%></p> <%
 	}
 			}
 %>
				</td>
			</tr>
			<tr>
				<th>Last Update Date:</th>
				<td><%=radioBroadcast.getLast_Update_Date()%></td>
			</tr>
		</table>
	</div>
	<br>
	<%
		}
		} else
		{
	%>
	<p>
		No Digital Radio data Available for
		<%=country%></p>
	<%
		}
	%>
	<h4>&nbsp;&nbsp;&nbsp;ANALOG RADIO DATA</h4>
	<%
		if (analogRadioBroadcasts.getAnalogRadioBroadcasts().size() != 0)
		{
	%>
	<%
		for (AnalogRadioBroadcast radioBroadcast : analogRadioBroadcasts.getAnalogRadioBroadcasts())
			{
	%>
	<div id="content">
		<%
			if (role.equalsIgnoreCase("Admin"))
					{
		%>
		<p align="center">
			<a href="/RadioBroadcastServlet?action=getThisBroadcastAnalog&&broadcastId=<%=radioBroadcast.getBroadcast_Id()%>">UPDATE DETAILS</a>
		</p>
		<%
			}
		%>
		<br>
		<table style="width: 90%;">
			<tr>
				<th>AM:</th>
				<td><%=radioBroadcast.getAm()%></td>
			</tr>
			<tr>
				<th>FM:</th>
				<td><%=radioBroadcast.getFm()%></td>
			</tr>
			<tr>
				<th>Major Players:</th>
				<td><%=radioBroadcast.getMajor_Players()%></td>
			</tr>
			<tr>
				<th>Notes/Remarks:</th>
				<td><%=radioBroadcast.getNotes_Remarks()%></td>
			</tr>
			<tr>
				<th>Last Update Date:</th>
				<td><%=radioBroadcast.getLast_Date_Updated()%></td>
			</tr>
		</table>
	</div>
	<br>
	<%
		}
		} else
		{
	%>
	<p>
		No Digital Radio data Available for
		<%=country%></p>
	<%
		}
	%>
</body>
</html>